package springboot.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import springboot.domain.ReportRepair;
import springboot.domain.StudentReportRepair;
import springboot.service.ReportRepairService;
import java.util.Collection;
@RestController
@RestControllerAdvice
public class PublicController {
    @Autowired
    private ReportRepairService reportRepairService;
    @GetMapping(value={"/ReportRepairMangerCheckReport/{pageNo}/{pageSize}"})
    @RequiresPermissions("CheckReport:get")
    public Collection<StudentReportRepair> ReportRepairMangerCheckReport(@PathVariable(name = "pageNo")int pageNo,
                                                                         @PathVariable(name = "pageSize")int pageSize){
        return reportRepairService.checkReport(pageNo,pageSize);
    }
    @GetMapping(value={"/ReportRepairFindAll/{pageNo}/{pageSize}"})
    @RequiresPermissions("ReportRepairFindAll:get")
    public Collection<ReportRepair> ReportRepairFindAll(@PathVariable(name = "pageNo")int pageNo,
                                                        @PathVariable(name = "pageSize")int pageSize){
        return reportRepairService.findAll(pageNo,pageSize);
    }
}
